package org.hdax.dm.dao.entitydao;

import org.hdax.dm.entity.linkuser.LinkUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

public interface LinkUserDao extends JpaRepository<LinkUser, Long> {

    LinkUser findByUserId(@Param("userId") Long userId);

    LinkUser findByIdCard(@Param("idCard") String idCard);

    @Modifying
    @Transactional
    void deleteByUserId(@Param("linkId") Integer linkId);
}
